package work812;

import java.io.File;

public class work5 {
  public static void main(String[] args) {
    File file = new File("E:\\bdqn\\javaDemo");
    File[] f = file.listFiles();
    File[] f2 = new File[f.length];
    for (int i = 0; i < f.length; i++) {
      if (f[i].isFile()){
        f2[i] = f[i];
        f[i] = null;
      }
    }
    System.out.println("文件：");
    for (File file1 : f2) {
      if (file1 != null){
        System.out.println(file1.getName());
      }
    }
    System.out.println("文件夹：");
    for (File file1 : f) {
      if (file1 != null){
        System.out.println(file1.getName());
      }
    }

  }
}
